const fields = [
  {
    dataIndex: 'index',
    key: 'index',
    title: '序号',
    width: 50,
    scopedSlots: {
      customRender: 'subscript'
    }
  },
  {
    dataIndex: 'name',
    key: 'name',
    title: '栏目名',
    width: 250
  },
  {
    dataIndex: 'status',
    key: 'status',
    title: '开放时间设置',
    width: 150
  },
  {
    title: '操作',
    key: 'action',
    fixed: 'right',
    scopedSlots: {
      customRender: 'action'
    }
  }
]

const formRow = [
  {
    span: 10,
    label: '栏目名称',
    component: 'AInput',
    placeholder: '请输入栏目名称',
    prop: 'name',
    allowClear: true
  },
  {
    span: 10,
    label: '栏目开放状态',
    component: 'ASelect',
    placeholder: '请选择栏目开放状态',
    prop: 'status',
    loading: false,
    disabled: false,
    isCustomList: true,
    customRequestList(instance) {
      instance.loading = true
      instance.disabled = true
      setTimeout(() => {
        instance.disabled = false
        instance.loading = false
        instance.list = [
          { label: '长期开放', value: '1' },
          { label: '暂不开放', value: '0' }
        ]
      }, 1000)
    },
    allowClear: true
  }
]

const slotOpt = [
  {
    slot: 'action',
    component: 'Action',
    list: [
      { name: '修改', cb: 'edit' }
    ]
  }
]

module.exports = {
  fields,
  formRow,
  slotOpt
}
